package com.tdrc.common.beans;

public enum ResultCode {
	/* 请求成功状态码 */
    OK(200, "操作成功"),
	/* 操作成功状态码 */
    CREATED(201, "操作成功"),
	/*请求失败状态码*/
    ERROR(500, "未知错误，请求失败！"),
    /* 权限错误：1001-1999 */
    PERMISSION_UNAUTHENTICATED(1001, "此操作需要登陆系统！"),
    PERMISSION_UNAUTHORISE(1002, "权限不足，无权操作！"),
    PERMISSION_EXPIRE(1003, "登录状态过期！"),
    PERMISSION_TOKEN_EXPIRED(1004, "token已过期"),
    PERMISSION_LIMIT(1005, "访问次数受限制"),
    PERMISSION_TOKEN_INVALID(1006, "无效token"),
    PERMISSION_SIGNATURE_ERROR(1007, "签名失败"),
    /* 用户错误：2001-2999*/
    USER_NOT_LOGGED_IN(2001, "用户未登录，请先登录"),
    USER_LOGIN_ERROR(2002, "账号不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN(2003, "账号已被禁用"),
    USER_NOT_EXIST(2004, "用户不存在"),
    USER_HAS_EXISTED(2005, "用户已存在"),
    USER_NAME_NOT_UNIQUE(2006,"用户名已存在"),
    USER_LOG_NAME_NOT_UNIQUE(2007,"登录名已存在"),
    /*角色错误:3001-3999*/
    ROLE_NAME_NOTE_UNIQUE(3001,"角色名字重复"),
    /*文件上传/下载代码*/
    FILE_UPLOAD_FAILURE(4001,"文件上传失败！"),
    FILE_UPLOAD_EMPTY(4002,"上传文件为空！"),
    FILE_DOWNLOAD_FAILURE(4003,"文件下载失败！");
    private int val;
    private String msg;

    private ResultCode(int value, String msg) {
        this.val = value;
        this.msg = msg;
    }

    public int getVal() {
        return val;
    }

    public void setVal(int val) {
        this.val = val;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int val() {
        return val;
    }

    public String msg() {
        return msg;
    }


}
